// pages/books/books.js
import {BookModel} from "../../models/book";
const bookModel = new BookModel();
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.showLoading({
      title:"加载中..."
    })
    bookModel.getHotBook().then(res=>{
      this.setData({
        books:res
      })
    })
    wx.hideLoading()
  },
  
  onTap(){
    wx.navigateTo({
      url:"/pages/search/search"
    })
  }

})